package com.htthorizon.model.controller;

import com.htthorizon.common.core.constant.Constants;
import com.htthorizon.common.log.annotation.Log;
import com.htthorizon.common.log.enums.BusinessType;
import com.htthorizon.model.response.*;
import com.htthorizon.model.service.IStatisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Brilliant
 */
@RestController
@RequestMapping("/statistics")
@Api("大屏指标")
public class StatisticsController {

    @Autowired
    private IStatisticsService statisticsService;

    @GetMapping("/modelStatus")
    @ApiModelProperty("模型管理大屏/模型状态占比情况")
    @Log(title = "模型大屏", businessType = BusinessType.QUERY)
    public ModelStatusVO modelStatus() {
        return statisticsService.modelStatus();
    }

    @GetMapping("/specialty")
    @ApiModelProperty("模型管理大屏/专业域分布统计")
    public SpecialtyVo specialty(){
        return statisticsService.specialty();
    }

    @GetMapping("/keyIndicator")
    @ApiModelProperty("模型管理大屏/关键指标")
    public KeyIndicatorVo keyIndicator(){
        return statisticsService.keyIndicator();
    }

    @GetMapping("/feedback")
    @ApiModelProperty("模型管理大屏/模型使用反馈情况统计")
    public FeedBackVo feedback(){
        return statisticsService.feedback();
    }

    @GetMapping("/modelType")
    @ApiModelProperty("模型管理大屏/各类型模型近6个月")
    public ModelTypeVo modelType(){
        return statisticsService.modelType2();
    }

    @GetMapping("/modelUse/{specType}/{page}/{pageSize}")
    @ApiModelProperty("模型管理大屏/模型使用情况")
    public ModelUseVo modelUse(@PathVariable("specType")Integer specType,@PathVariable("page")Integer page,@PathVariable("pageSize")Integer pageSize){
        return statisticsService.modelUse(specType,page,pageSize);
    }

    @GetMapping("/modelUse/city")
    @ApiModelProperty("模型管理大屏/各市公司使用模型top5")
    public ModelUseCityVo modelUseCityVo(){
        return statisticsService.modelUseCityVo2();
    }

}
